// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: 'gezi-ofhmx'
})

const db = cloud.database()
exports.main = async(event, context) => {
  var name = event.name
  var hend = event.hend
  var openId = event.openId
  return await db.collection('user').add({
    // data 字段表示需新增的 JSON 数据
    data: {
      name: name,
      hend: hend,
      seeNum:0,
      tiwenNum:0,
      _openId: openId
    }
  })

}

